package com.hison.controller;

import com.hison.annotation.SystemLog;
import com.hison.domian.entity.User;
import com.hison.service.SysUserService;
import com.hison.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: UserController
 * @Descripiton: TODO
 * @Author: 小郑
 * @Date： 2024/1/13 16:08
 * @Version：1.8
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    //UserService是我们在huanf-framework工程写的接口
    private SysUserService userService;

    @GetMapping("/userInfo")
    @SystemLog(businessName = "更新用户")
    public ResponseResult userInfo(String userId){
        return userService.userInfo(userId);
    }

    @PutMapping("userInfo")
    public ResponseResult  updateUserInfo(@RequestBody User user){
        //更新个人信息
        return userService.updateUserInfo(user);
    }

    @PostMapping("/register")
    public ResponseResult register(@RequestBody User user){
        //注册功能
        return userService.register(user);
    }
}